package com.ssl.deadlock.dao;

import com.ssl.deadlock.domain.UserSeal;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * 描述：
 *
 * @author ssl
 * @create 2021/03/01 17:29
 */
public interface UserSealDao extends JpaRepository<UserSeal, Long>, JpaSpecificationExecutor<UserSeal> {

    @Modifying
    @Query(value = "update deadlock_user_seal set defaulted = ?1 where user_id = ?2", nativeQuery = true)
    void updateDefaulted(Boolean defaulted, Long userId);
}
